$('form').on('submit', async function (e) {
  e.preventDefault()
  const username = $('#username').val()
  const password = $('#password').val()
  console.log(username, password);

  const { data: res } = await axios.post('http://124.223.14.236:3001/api/user/login',
    {
      username,
      password
    }

  )
  console.log(res);
  if (res.success !== true) return alert('登录失败 ' + res.msg)
  localStorage.setItem('token', res.data.token)
  localStorage.setItem('id', res.data.id)
  alert('登录成功')

})